#pragma once
namespace bit
{
	// 适配器 -- 复用
	template<class Iterator, class Ref, class Ptr>
	struct Reverse_iterator
	{
        typedef Reverse_iterator<Iterator,Ref,Ptr> Self;
        Reverse_iterator(Iterator it):_it(it) {}

        Self& operator++()
        {
            _it--;
            return *this;
        }

        Self operator++(int)
        {
            Self temp = _it;
            _it--;
            return temp;
        }

        Self& operator--()
        {
            _it++;
            return *this;
        }

        Self operator--(int)
        {
            Self temp = _it;
            _it++;
            return temp;
        }

        bool operator!=(const Self& s)
        {
            return _it != s._it;
        }

        bool operator==(const Self& s)
        {
            return _it == s._it;
        }

        Ref operator*()
        {
            Iterator temp = _it;
            return *(--temp);
        }

        Ptr operator->()
        {
            return &(operator*());
        }

		Iterator _it;
	};
    
}
